********************************************************************************
* Purpose: Imams data analysis - scaleup Eid ul Azha 2020 
* Sub-file: Suspicion of MS 
********************************************************************************

	****************************************************************************
	* Load data
	****************************************************************************

	use			"${imamsurvey}/merged_scaleup.dta" , clear 
	
	keep		if consent_statement==1											// Restrict the sample here to people who responded in the baseline / T calls
																				
	****************************************************************************
	* Estimates
	****************************************************************************\
	
	estimates	clear 

	local		j = 0 
	
	foreach		i in suspicious {

				local		j = `j' + 1
	
				* T vs. C
	
				reg 		`i' treatment_any , robust 						
	
				est			sto est`j'_1
				
				sum			`i' if treatment_any==0 
				estadd		scalar cmean = r(mean) 

				
				* T1 vs. T2 vs. C - no controls
	
				reg 		`i' treatment_combined treatment_secular , robust 						
				
				est 		sto est`j'_2
				
				estadd		local covariates "No"
				
				test 		treatment_combined = treatment_secular
				estadd 		scalar pval = round(r(p), .01)
				
				test		treatment_combined = treatment_secular = 0 
				estadd 		scalar pvaljoint = round(r(p), .01)				

				

				* HTE BL correct
				
				reg			`i' treatment_any##blcorrect , robust 
				
				est			sto est`j'_hte1				

				* HTE # praying at maghrib
				
				reg			`i' treatment_any##nb_mag_pray_high , robust 
				
				est			sto est`j'_hte2				
				
				
				
				local		labi : variable label `i' 
				
				global		estimatesplot $estimatesplot ( est`j'_1 , label(`labi'))
				

	}

	****************************************************************************
	* Table 
	****************************************************************************
	
	esttab		est* using "${texrct}/scaleup_ms_suspicious.tex" , ///
					replace star(* .1 ** .05 *** .01) se  t(3) b(3) label ///
					drop(_cons) ///
					scalars("cmean Control group mean") ///
					nonotes fragment booktabs nomtitles nodepvars noomitted nobaselevels
					
	

																				
